# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.
#
# Originally from: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-defusedcsv

pkgname=python-defusedcsv
_pkgname=defusedcsv
pkgver=2.0.0
pkgrel=1
pkgdesc='Drop-in replacement for Python CSV library that tries to mitigate CSV injection attacks'
arch=('any')
url='https://github.com/raphaelm/defusedcsv'
license=('Apache-2.0')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel'
             'python-setuptools')
source=("https://github.com/raphaelm/defusedcsv/archive/refs/tags/v$pkgver.tar.gz")
sha512sums=('7ea60e23025b2392a34fbc0aa5ef6dd1b6ce0c653000e4121fceed4159b99b233c34f0f8f1e06931e721a8c923e90faa63b39d0032ab1881ff94eaea66345d4a')

# https://wiki.archlinux.org/title/Python_package_guidelines#Standards_based_(PEP_517)
build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --no-isolation
}

package() {
  cd "$_pkgname-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

